<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('cdjadmin');
    //return view('welcome');
})->prefix('/');

Route::group(['prefix' => '/Admin', 'namespace' => 'Auth\Admin', 'middleware' => ['cors']], function () {
    //获取登录code
    Route::get('info', 'LoginController@info');
    //登录
    Route::post('login', 'LoginController@login');
    Route::get('test', 'LoginController@test');
});

Route::group(['prefix' => '/Admin', 'namespace' => 'Auth\Admin', 'middleware' => ['admin.refresh.token', 'jwt.role:admin']], function () {
    Route::get('logout', 'LoginController@logout');
    Route::get('userInfo', 'LoginController@userInfo');
    Route::get('refresh', 'LoginController@refresh');
    Route::post('changePassword', 'LoginController@changePassword');
});

Route::group(['prefix' => '/I', 'namespace' => 'Admin'], function () {
    Route::get('/{prefix}', 'DataController@index');
});

Route::group(['prefix' => '/Admin', 'namespace' => 'Admin'], function () {
    Route::get('getTotal', 'DataController@getTotal');
    Route::get('getLastYearTradeMoney', 'DataController@getLastYearTradeMoney');
    Route::get('getGuestRegionSpread', 'DataController@getGuestRegionSpread');
    Route::get('getGuestTypeProportion', 'DataController@getGuestTypeProportion');
    Route::get('getGuestTradingVolume', 'DataController@getGuestTradingVolume');
    Route::get('getGuestOrders', 'DataController@getGuestOrders');
    Route::get('getGuestUserNumber', 'DataController@getGuestUserNumber');
    Route::get('getStandardCategorySalesSpread', 'DataController@getStandardCategorySalesSpread');
    Route::get('getStandardGoodsSale', 'DataController@getStandardGoodsSale');
    Route::get('getStandardGoodsTrading', 'DataController@getStandardGoodsTrading');
    Route::get('getCompanyLogLat', 'DataController@getCompanyLogLat');

    Route::get('getSelect', 'DataController@getSelect');
});


Route::group(['prefix' => '/Admin', 'namespace' => 'Supply', 'middleware' => ['admin.refresh.token', 'jwt.role:admin', 'permission']], function () {
    // 供应商管理
    Route::post('supply/uptown', 'IndexController@uptown');
    Route::get('supply/info', 'IndexController@info');
    Route::get('supply/list', 'IndexController@list');
});


Route::group(['prefix' => '/Admin', 'namespace' => 'Admin', 'middleware' => ['admin.refresh.token', 'jwt.role:admin', 'permission']], function () {
    // 数据字典
    Route::get('dicionry/info', 'DicionaryController@info');

    // 代理商
    Route::post('agent/operateAgent', 'AgentController@operateAgent');
    Route::get('agent/info', 'AgentController@info');
    Route::get('agent/list', 'AgentController@list');

    // 代理商管理员
    Route::get('agent/administratorByAgentId', 'AgentController@administratorByAgentId');
    Route::get('agent/loginAgentNoPass', 'AgentController@loginAgentNoPass');
    Route::get('agent/changePasswordAgentAdmin', 'AgentController@changePasswordAgentAdmin');

    // 广告管理
    Route::post('advertisment/operate', 'AdvertismentController@operate');
    Route::get('advertisment/info', 'AdvertismentController@info');
    Route::get('advertisment/list', 'AdvertismentController@list');

    // 学校管理
    Route::post('school/operate', 'SchoolController@operate');
    Route::get('school/info', 'SchoolController@info');
    Route::get('school/list', 'SchoolController@list');



    Route::post('share', 'DataController@share');
    Route::get('getShareUrl', 'DataController@getShareUrl');
    Route::post('saveData', 'DataController@saveData');
    Route::get('getSort', 'DataController@getSort');
    Route::post('saveSelect', 'DataController@saveSelect');
    Route::post('delete', 'DataController@delete');

    Route::get('/', 'IndexController@index');
    Route::get('index', 'IndexController@index');

    /************客户管理*************************/
    //客户列表
    Route::get('company/list', 'CompanyController@list');
    //获取客户详情
    Route::get('company/getCompanyDetail', 'CompanyController@getCompanyDetail');
    //新增客户
    Route::post('company/addCompany', 'CompanyController@addCompany');
    //编辑客户
    Route::post('company/editCompany', 'CompanyController@editCompany');
    //获取所有客户列表，不分页
    Route::get('company/getAllCompany', 'CompanyController@getAllCompany');
    Route::get('company/test', 'CompanyController@test');

    //根据父id获取子地区
    Route::get('company/regionListByPid', 'CompanyController@regionListByPid');
    //根据客户id，获取客户的超级管理员列表
    Route::get('company/administratorByComId', 'CompanyController@administratorByComId');
    //修改客户的超级管理员密码
    Route::post('company/changePasswordComAdmin', 'CompanyController@changePasswordComAdmin');
    //免密登陆-客户
    Route::get('company/loginCompanyNoPass', 'CompanyController@loginCompanyNoPass');
    //新增集团客户
    Route::post('company/addGroupClient', 'GroupClientController@addGroupClient');
    //编辑集团客户
    Route::post('company/editGroupClient', 'GroupClientController@editGroupClient');
    //搜索没有集团的客户
    Route::get('company/getCompanyListNoGroup', 'GroupClientController@getCompanyListNoGroup');
    //获取集团客户列表
    Route::get('company/getGroupClientList', 'GroupClientController@getGroupClientList');
    //获取集团的超级管理员
    Route::get('company/getGroupClientAdminList', 'GroupClientController@getGroupClientAdminList');
    //修改集团客户的超级管理员密码
    Route::post('company/changePasswordGroupAdmin', 'GroupClientController@changePasswordGroupAdmin');
    //免密登陆-集团客户
    Route::get('company/loginGroupNoPass', 'GroupClientController@loginGroupNoPass');
    //获取集团客户详情
    Route::get('company/groupClientDetail', 'GroupClientController@groupClientDetail');

    Route::post('company/checkCompany', 'CompanyController@checkCompany'); //客户审核


    //获取客户菜单类型
    Route::get('company/menuType', 'CompanyController@menuType');
    //根据类型获取菜单列表
    Route::get('company/menuList', 'CompanyController@menuList');
    //新增菜单
    Route::post('company/addMenu', 'CompanyController@addMenu');
    //编辑菜单
    Route::post('company/editMenu', 'CompanyController@editMenu');
    //删除菜单
    Route::get('company/deleteMenu', 'CompanyController@deleteMenu');
    //获取菜单详情
    Route::get('company/getMenuDetail', 'CompanyController@getMenuDetail');
    //根据父id获取子菜单
    Route::get('company/menuListByPid', 'CompanyController@menuListByPid');

    //客户跟踪
    Route::get('company/trackList', 'CompanyTrackController@index');
    Route::get('company/trackInfo', 'CompanyTrackController@info');
    Route::post('company/importTrack', 'CompanyTrackController@importTrack');

    //客户类型
    Route::get('company/typeList', 'CompanyTypeController@index');
    Route::post('company/addType', 'CompanyTypeController@add');
    Route::post('company/editType', 'CompanyTypeController@edit');

    //老系统客户列表
    Route::get('company/getOldSystem', 'CompanyController@getOldSystem');

    //产品
    Route::get('product/index', 'ProductController@index');
    Route::post('product/add', 'ProductController@add');
    Route::post('product/edit', 'ProductController@edit');

    /************学校端配置管理*************************/
    // 获取学校菜单列表
    Route::get('school/menuList', 'SchoolMenuController@menuList');
    // 获取学校菜单详情
    Route::get('school/getMenuDetail', 'SchoolMenuController@getMenuDetail');
    // 新增学校菜单
    Route::post('school/addMenu', 'SchoolMenuController@addMenu');
    // 编辑学校菜单
    Route::post('school/editMenu', 'SchoolMenuController@editMenu');
    // 删除学校菜单
    Route::get('school/deleteMenu', 'SchoolMenuController@deleteMenu');
    // 根据父id获取子学校菜单
    Route::get('school/menuListByPid', 'SchoolMenuController@menuListByPid');


    /************配置管理*************************/

    //获取菜单列表
    Route::get('global/menuList', 'AdminMenuController@menuList');
    //获取菜单详情
    Route::get('global/getMenuDetail', 'AdminMenuController@getMenuDetail');
    //新增菜单
    Route::post('global/addMenu', 'AdminMenuController@addMenu');
    //编辑菜单
    Route::post('global/editMenu', 'AdminMenuController@editMenu');
    //删除菜单
    Route::get('global/deleteMenu', 'AdminMenuController@deleteMenu');
    //根据父id获取子菜单
    Route::get('global/menuListByPid', 'AdminMenuController@menuListByPid');

    //管理员管理
    Route::get('global/adminUserList', 'UserController@index');
    Route::post('global/addAdminUser', 'UserController@add');
    Route::post('global/editAdminUser', 'UserController@edit');
    Route::post('global/deleteAdminUser', 'UserController@delete');

    /*++++++++++++++++++++++++++++++角色管理++++++++++++++++++++++++++++++++++*/
    Route::get('global/roleIndex', 'AdminRoleController@index');
    Route::post('global/addRole', 'AdminRoleController@add');
    Route::post('global/editRole', 'AdminRoleController@edit');
    Route::post('global/deleteRole', 'AdminRoleController@delete');
    Route::get('global/authRole', 'AdminRoleController@auth');
    Route::post('global/accreditRole', 'AdminRoleController@accredit');

    /*++++++++++++++++++++++++++++++日志管理+++++++++++++++++++++++++++++++++++*/
    Route::get('global/logIndex', 'OperateLogController@index');


    /************商品管理*************************/
    //获取标准库列表
    Route::get('goods/standardList', 'GoodsStandardController@index');
    //新增标准库
    Route::post('goods/addStandardGoods', 'GoodsStandardController@add');
    //获取信息接口
    Route::get('goods/standardBase', 'GoodsStandardController@baseData');
    //编辑标准库
    Route::post('goods/editStandardGoods', 'GoodsStandardController@edit');
    //标准库详情
    Route::get('goods/standardDetail', 'GoodsStandardController@info');
    //验证名称唯一
    Route::post('goods/standardCheck', 'GoodsStandardController@checkName');

    //获取非标准库列表
    Route::get('goods/nonStandardList', 'GoodsNonstandardController@index');
    //编辑非标准库
    //    Route::post('goods/editNonStandardGoods','GoodsNonstandardController@edit');
    //非标准库详情
    Route::get('goods/nonStandardDetail', 'GoodsNonstandardController@info');
    //验证名称唯一
    Route::post('goods/nonStandardCheck', 'GoodsNonstandardController@checkName');
    //非标准库导入标准库
    Route::post('goods/importStandard', 'GoodsNonstandardController@importStandard');


    //辅助资料列表
    Route::get('goods/datumList', 'GoodsDatumController@index');
    //添加
    Route::post('goods/addDatum', 'GoodsDatumController@add');
    //编辑
    Route::post('goods/editDatum', 'GoodsDatumController@edit');
    //删除资料
    Route::post('goods/deleteDatum', 'GoodsDatumController@delete');

    //获取商品分类
    Route::get('goods/categoryList', 'GoodsCategoryController@index');
    //增加
    Route::post('goods/addCategory', 'GoodsCategoryController@add');
    //编辑
    Route::post('goods/editCategory', 'GoodsCategoryController@edit');
    //删除
    Route::post('goods/deleteCategory', 'GoodsCategoryController@dieDelete');

    /******************文档管理********************/
    //客户手册
    Route::get('document/companyManualList', 'DocumentController@index');
    Route::get('document/companyManualDetail', 'DocumentController@info');
    Route::post('document/addCompanyManual', 'DocumentController@add');
    Route::post('document/editCompanyManual', 'DocumentController@edit');
    Route::post('document/delCompanyManual', 'DocumentController@delete');
    Route::get('document/companyManualBaseData', 'DocumentController@baseData');
    //站内通知
    Route::post('document/addSiteNotice', 'DocumentController@addSiteNotice');
    //招标采集
    Route::get('document/tenderList', 'DocumentController@tenderList');
    Route::get('document/deleteTender', 'DocumentController@deleteTender');
    Route::get('document/changeTender', 'DocumentController@changeTender');


    /*+++++++++++++++++++++++++++++订单管理++++++++++++++++++++++++++++++++*/
    Route::get('order/index', 'OrderController@index');
    Route::get('order/info', 'OrderController@info');
    Route::get('order/base', 'OrderController@base');

    /*++++++++++++++++++++++++++++++字段管理++++++++++++++++++++++++++++++++*/
    Route::post('field/save', 'ListFieldController@saveField');

    #导出订单
    Route::post('export/exports', 'ExportsController@exports');
    Route::get('export/exports_info', 'ExportsController@exports_info');
    Route::post('export/export_all', 'ExportsController@export_all');
    Route::post('export/export_all_info', 'ExportsController@export_all_info');
    #导出订单详情
    Route::post('export/export_order_info', 'ExportsController@export_order_info');

    //导出客户
    Route::post('export/exportsCompany', 'ExportsController@exportsCompany');

    //导出报表-客户分析订单
    Route::post('export/exportsAnalysisList', 'ExportsController@exportsAnalysisList');

    /*+++++++++++++++++++++++++++++佣金管理++++++++++++++++++++++++++++++++*/
    Route::get('commission/index', 'CommissionController@index');
    Route::get('commission/info', 'CommissionController@info');

    //域名解析
    Route::get('dns/dnsList', 'DnsController@dnsList');
    Route::get('dns/addRecord', 'DnsController@addRecord');
    Route::get('dns/editRecord', 'DnsController@editRecord');
    Route::get('dns/deleteRecord', 'DnsController@deleteRecord');
    Route::post('dns/editRemark', 'DnsController@editRemark');

    //在线图库
    Route::get('img/categoryList', 'ImgController@categoryList');
    Route::get('img/imgList', 'ImgController@imgList');
    Route::post('img/addCategory', 'ImgController@addCategory');
    Route::post('img/editCategory', 'ImgController@editCategory');
    Route::get('img/deleteCategory', 'ImgController@deleteCategory');
    Route::post('img/addImg', 'ImgController@addImg');
    Route::get('img/deleteImg', 'ImgController@deleteImg');

    //检测项目
    Route::get('testItem/itemList', 'DocumentController@itemList');
    Route::post('testItem/addItem', 'DocumentController@addItem');
    Route::post('testItem/editItem', 'DocumentController@editItem');
    Route::get('testItem/deleteItem', 'DocumentController@deleteItem');

    //系统配置
    Route::get('setting/info', 'AdminMenuController@settingInfo');
    Route::post('setting/edit', 'AdminMenuController@editSetting');
    Route::post('setting/add', 'AdminMenuController@addSetting');

    //设备清单
    Route::get('goods/devList', 'DevController@devList');
    Route::post('goods/addDev', 'DevController@addDev');
    Route::post('goods/editDev', 'DevController@editDev');
    Route::get('goods/devDetail', 'DevController@devDetail');
    Route::get('goods/exportDev', 'DevController@exportDev');

    //货到付款佣金
    Route::get('financial/offlineCommissionList', 'CommissionController@offlineCommissionList');
    Route::post('financial/addBill', 'CommissionController@addBill');
    Route::get('financial/invalidBill', 'CommissionController@invalidBill');
    Route::post('financial/account', 'CommissionController@account');
    Route::post('financial/zero', 'CommissionController@zero');
    Route::post('financial/setBill', 'CommissionController@setBill');
    Route::get('financial/getBillDays', 'CommissionController@getBillDays');
    Route::get('financial/getBillLife', 'CommissionController@getBillLife');
    Route::get('financial/offlineCommissionDetail', 'CommissionController@offlineCommissionDetail');
    Route::post('financial/settlement', 'CommissionController@settlement');

    //基础
    Route::get('base/getCompanyListByName', 'IndexController@getCompanyListByName');

    //设备订单
    Route::get('financial/devOrderList', 'DevOrderController@devOrderList');
    Route::get('financial/devOrderDetail', 'DevOrderController@devOrderDetail');
    Route::get('financial/devOrderLogisticsInfo', 'DevOrderController@devOrderLogisticsInfo');
    Route::get('financial/devOrderDelivery', 'DevOrderController@devOrderDelivery');
    Route::get('financial/getExpressCompany', 'DevOrderController@getExpressCompany');
    Route::get('financial/devOrderLife', 'DevOrderController@devOrderLife');

    //根据客户类型，获取产品列表
    Route::get('company/productByComId', 'CompanyController@productByComId');

    //根据产品，获取菜单列表，包含排除菜单
    Route::get('company/menuListExclude', 'CompanyController@menuListExclude');
    Route::post('company/excludeMenu', 'CompanyController@excludeMenu');

    //获取角色列表
    Route::get('product/getCustRoleList', 'ProductController@getCustRoleList');
    //新增角色
    Route::post('product/addCustRole', 'ProductController@addCustRole');
    //编辑角色
    Route::post('product/editCustRole', 'ProductController@editCustRole');

    //获取客服列表
    Route::get('company/getCustList', 'CustomerController@getCustList');
    //Route::get('company/getCustListAll','CustomerController@getCustListAll');
    //新增客服
    Route::post('company/addCust', 'CustomerController@addCust');
    //编辑客服
    Route::post('company/editCust', 'CustomerController@editCust');
    Route::get('company/getCustDetail', 'CustomerController@getCustDetail');
    //根据客服id，获取客户列表
    Route::get('company/getUserListByCustId', 'CustomerController@getUserListByCustId');
    //根据客户id，获取聊天记录
    Route::get('company/getMsgListByUserId', 'CustomerController@getMsgListByUserId');


    //续费订单
    Route::get('renew/index', 'CommissionController@getRenewOrder');
    Route::post('renew/export', 'ExportsController@exportRenewOrder');

    //微信客服
    Route::get('customer/index', 'CustomerWxController@index');
    Route::post('customer/add', 'CustomerWxController@add');
    Route::post('customer/edit', 'CustomerWxController@edit');
    Route::post('customer/delete', 'CustomerWxController@delete');

    //
    Route::get('company/getCustListAll', 'CustomerWxController@getCustListAll');

    /*采购分析*/
    Route::get('purchase/getRegion', 'PurchaseAnalysisController@getRegion');
    Route::get('purchase/getGoodsList', 'PurchaseAnalysisController@getGoodsList');
    Route::get('purchase/getCustomers', 'PurchaseAnalysisController@getCustomers');
    Route::get('purchase/priceList', 'PurchaseAnalysisController@index');

    /*销售分析*/
    Route::get('sales/getRegion', 'SalesAnalysisController@getRegion');
    Route::get('sales/getGoodsList', 'SalesAnalysisController@getGoodsList');
    Route::get('sales/getCustomers', 'SalesAnalysisController@getCustomers');
    Route::get('sales/priceList', 'SalesAnalysisController@index');

    /*应用管理*/
    Route::get('service/index', 'ServiceAppController@index');
    Route::post('service/add', 'ServiceAppController@add');
    Route::post('service/edit', 'ServiceAppController@edit');
    Route::post('service/delete', 'ServiceAppController@delete');

    //客户分析
    Route::get('company/chart', 'CompanyAnalysisController@index');
    Route::get('company/getHistogram', 'CompanyAnalysisController@getHistogram');
    Route::get('company/getGraph', 'CompanyAnalysisController@getGraph');
    Route::get('company/analysisList', 'CompanyAnalysisController@list');
});

Route::group(['prefix' => '/Admin', 'namespace' => 'Admin'], function () {
    /*++++++++++++++++++++++++++++++图片上传++++++++++++++++++++++++++++++++*/
    Route::post('upload/upload_file', 'UploadController@upload_file');
    Route::post('upload/upload_img', 'UploadController@upload_img');
});


//Route::get('notice', function(){
//    event(new \App\Events\NoticeEvent(1,['title'=>'123']));
//});



Route::get('/phone', function () { //移动端
    return view('phone');
});
